package com.learn.game_challenger.entity;

public class role {
    // 定义玩家属性
    private String name;
    private int attack;
    private int defense;
    private int health;

    public role(String name, int attack, int defense, int health) {
        this.name = name;
        this.attack = attack;
        this.defense = defense;
        this.health = health;
    }

    public int getAttack() {
        return attack;
    }

    public int getDefense() {
        return defense;
    }

    public int getHealth() {
        return health;
    }

    public String getName() {
        return name;
    }
    public void sethealth(int health) {
        this.health = health;
    }
    public void setAttack(int attack) {
        this.attack = attack;
    }
    public void setDefense(int defense) {
        this.defense = defense;
    }

    public void Show()
    {
        System.out.println("攻击力: " + attack);
        System.out.println("防御力: " + defense);
        System.out.println("生命值: " + health);
    }
}
